package com.ljc.dao;

import com.ljc.entity.ProjectPlanning;
import com.ljc.vo.ProjectPlanningReviewSearch;
import com.ljc.vo.ProjectPlanningSearch;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface ProjectPlanningDao {

    void addPurchasePlanning(ProjectPlanning projectPlanning);

    void updatePurchasePlanning(ProjectPlanning projectPlanning);

    @Update("update project_planning set deleted=1 where id=#{id}")
    void deleteById(@Param("id") int id);

    @Select("select * from purchase_planning where user_id=#{id}")
    List<ProjectPlanning> getByUserId(int id);

    List<ProjectPlanning> searchByCollegeUser(ProjectPlanningSearch projectPlanningSearch);

    ProjectPlanning getById(int id);

    List<ProjectPlanning> searchByAdministrate(ProjectPlanningReviewSearch projectPlanningReviewSearch);

    @Update("update project_planning set status=#{status} where id=#{id}")
    void setStatus(@Param("id") int id,@Param("status") int status);

    List<ProjectPlanning> searchByExpertUser(ProjectPlanningSearch projectPlanningSearch);


}
